local t = Def.ActorFrame {};

--- Banner
t[#t+1] = Def.ActorFrame {
	Def.ActorFrame { -- Color
		Def.Quad {
			InitCommand=cmd(zoomto,500,SCREEN_HEIGHT;horizalign,left;vertalign,top;x,SCREEN_LEFT;y,SCREEN_TOP;);
			OnCommand=cmd(diffuse,color("#303F9F");diffusealpha,0.7;addx,-500;decelerate,0.6;addx,500;);
			OffCommand=cmd(decelerate,0.5;addx,-500;);
		};
	};
};

-- t[#t+1] = Def.ActorFrame {
	-- Def.ActorFrame { -- Color
		-- Def.Quad {
			-- InitCommand=cmd(zoomto,387,220;horizalign,left;x,SCREEN_LEFT+45;y,SCREEN_CENTER_Y-55);
			-- OnCommand=cmd(diffuse,color("#26C6DA");diffusealpha,0;smooth,0.2;diffusealpha,1);
			-- OffCommand=cmd(decelerate,0.3;diffusealpha,0;addx,10;);
		-- };
	-- };
-- };

t[#t+1] = Def.ActorFrame {
		Def.Quad {
			InitCommand=cmd(horizalign,left;x,SCREEN_LEFT+45;zoomto,387,35;y,SCREEN_CENTER_Y+145-18);
			OnCommand=cmd(diffuse,PlayerColor(PLAYER_1);diffusealpha,0;smooth,0.2;diffusealpha,1);
			OffCommand=cmd(decelerate,0.3;diffusealpha,0;addx,10;);
		};
};

t[#t+1] = Def.ActorFrame {
		Def.Quad {
			InitCommand=cmd(horizalign,left;x,SCREEN_LEFT+45;zoomto,387,35;y,SCREEN_CENTER_Y+162);
			OnCommand=cmd(diffuse,PlayerColor(PLAYER_2);diffusealpha,0;smooth,0.2;diffusealpha,1);
			OffCommand=cmd(decelerate,0.3;diffusealpha,0;addx,10;);
		};
};

t[#t+1] = Def.ActorFrame {
		Def.Quad {
			InitCommand=cmd(horizalign,left;x,SCREEN_LEFT+45;zoomto,220,70;y,SCREEN_CENTER_Y+145);
			OnCommand=cmd(diffuse,color("#26C6DA");diffusealpha,0;smooth,0.2;diffusealpha,1);
			OffCommand=cmd(decelerate,0.3;diffusealpha,0;addx,10;);
		};
};


t[#t+1] = StandardDecorationFromFileOptional("CourseContentsList","CourseContentsList") .. {
}

t[#t+1] = Def.Sprite {
		name="CourseBanner";
        InitCommand=cmd(x,SCREEN_LEFT+155;y,SCREEN_CENTER_Y+145); 
		OffCommand=cmd(decelerate,0.3;diffusealpha,0;addx,10;);
		OnCommand=cmd(diffusealpha,0;smooth,0.2;diffusealpha,1);
		ChangedCommand=cmd(finishtweening;smooth,0.2;zoomx,0.8);
		TransitionCommand=cmd(finishtweening;zoomx,0.8;diffusealpha,0;decelerate,0.2;zoom,1;diffusealpha,1;);
        CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); 
        CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); 
        SetCommand=function(self) 
            local course = GAMESTATE:GetCurrentCourse(); 
			if course then
                if course:HasBanner() then
					self:playcommand("Changed")
                    self:Load(course:GetBannerPath())
					self:playcommand("Transition")
                    self:scaletoclipped(220,70)
                else
					self:playcommand("Changed")
                    self:Load(THEME:GetPathG("Common fallback", "banner"))
					self:scaletoclipped(220,70)
					self:playcommand("Transition")
                end
			else
				self:diffusealpha(0)
            end
        end;
		};

return t